package com.xiaoshou.util;

import javax.servlet.ServletContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class SpringUtils {

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static Object getBean(ServletContext context, Class clazz) {
		return WebApplicationContextUtils.getRequiredWebApplicationContext(
				context).getBean(clazz);
	}
	
}
